import request from "@/utils/request.js";

const api_prefix = "/category";

export function list(username) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/list`,
    method: "GET",
    params: username,
  });
}

export function saveAdmin(data) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/save`,
    method: "POST",
    data: data
  });
}

export function echo(id) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/getById/${id}`,
    method: "GET"
  });
}

export function update(data) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/update`,
    method: "PUT",
    data: data,
  });
}

export function removeBatchByKeys(keys) {
  return request({
    //模板字符串拼接参数
    url: `${api_prefix}/remove/${keys}`,
    method: "DELETE",
  });
}
